<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input id="upload" type="file">
    <img src="#" alt="">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.js"></script>
    <script>
        jQuery("#upload").on({
            change:function(e){
                console.log(e.target.files[0]);
                console.log(URL.createObjectURL(e.target.files[0]));
                let fileReader = new FileReader();
                fileReader.readAsDataURL(e.target.files[0]);
                fileReader.onload = function(){
                    console.log(this);
                    jQuery("img").attr("src",this.result);
                }
            }
        });
    </script>
</body>
</html>